#ifndef SINGLEPLAYERMODULE_H
#define SINGLEPLAYERMODULE_H

#include <QObject>
#include "noise.h"

enum LengthRange{SHORT,MEDIUM,LONG,VERY_LONG};
enum SpeedRange{SLOW,NORMAL,FAST};
enum FactorRange{SMALL,MODERATE,HIGH,VERY_HIGH};

class DrunkSceneModel;
class QTime;

class SinglePlayerModule : public QObject{
    Q_OBJECT
public:
    ~SinglePlayerModule();
    SinglePlayerModule(int updateStateInterval,Noise *noise,int numberOfObjects=20,int heightRange=MEDIUM,int speedRange=NORMAL,
                       int penaltyRange=MODERATE,int difficultyRange=MODERATE,QObject *parent = 0);
    DrunkSceneModel* getModel();
public slots:
    void simulateOpponentMovement();
    void playerFinishedAt(int);
signals:
    void opponentAt(float);
    void win(bool,int);
private:
    bool isStanding;
    float movementSpeed;
    float yPosition;
    float falldownProbability;//useless now unless a distribution is used
    int updateStateInterval;
    int intervalsToStand;
    int fallingDownPenalty;
    int playerFinishingTime;
    float mapHeight;

    DrunkSceneModel *model;
    QTime *startedAt;
    QTime *finishedAt;
};

#endif // SINGLEPLAYERMODULE_H
